using System;
using WindowsPhoneMVC.Navigation;

namespace WindowsPhoneMVC.ActionResults
{
    /// <summary>
    /// Base class for controller action results
    /// </summary>
    public abstract class ActionResult
    {
        protected NavigationContext Context { get; private set; }

        protected ActionResult(NavigationContext context)
        {
            Context = context;
        }

        /// <summary>
        /// Executes result.
        /// </summary>
        public void Execute()
        {
            ExecuteInternal();
        }

        /// <summary>
        /// Executes result.
        /// </summary>
        protected abstract void ExecuteInternal();
    }
}